#pragma once


// OIS 
#include <OISMouse.h>
#include <OISKeyboard.h>
#include <OgreSingleton.h>
namespace CEGUI {
    class OgreRenderer;
    class System;
    class Window;
    class LuaScriptModule;
}
namespace Ogre {
    class RenderTarget;
    class RenderWindow;
}
struct lua_State;

class UI: public Ogre::Singleton<UI>, public OIS::KeyListener, public OIS::MouseListener {
public:
    CEGUI::System* getSystem() { return mSystem; }
    CEGUI::Window* getWindow() { return mLayout; }
//    static CEGUI::LuaScriptModule* getLua() { return mLua; }
    void init(Ogre::RenderWindow *window);
    void load(const std::string &script);
    UI();
    virtual ~UI();
private:
    bool keyPressed( const OIS::KeyEvent &e );
    bool keyReleased( const OIS::KeyEvent &e );

    bool mouseMoved( const OIS::MouseEvent &e );
    bool mousePressed( const OIS::MouseEvent &e, OIS::MouseButtonID id );
    bool mouseReleased( const OIS::MouseEvent &e, OIS::MouseButtonID id );

    Ogre::RenderTarget *mRenderTarget;
    CEGUI::OgreRenderer* mGUIRenderer;
    CEGUI::System* mSystem;
    CEGUI::Window* mLayout;
    lua_State* mLuaState;
    bool mMouseInWindow;
 //   CEGUI::LuaScriptModule *mLua;
    //static UI *mUI;
};

